package com.carb.interceptor;

import com.carb.enums.EmployeePosition;
import com.carb.enums.UserRole;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 管理员拦截器
 */
@Component
public class JwtTokenAdminInterceptor extends JwtTokenInterceptor {

    /**
     * 获取管理员角色
     * @return 管理员角色
     */
    @Override
    protected List<String> getRequiredRole() {
        return List.of(UserRole.ADMIN.getDesc(),
                EmployeePosition.STORE_MANAGER.getDesc(),
                EmployeePosition.CASHIER.getDesc(),
                EmployeePosition.PURCHASER.getDesc(),
                EmployeePosition.WAITER.getDesc());
    }

}
